//package com.example.demo.job;
//
//
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.scheduling.annotation.AsyncConfigurer;
//import org.springframework.scheduling.annotation.EnableAsync;
//import org.springframework.scheduling.annotation.EnableScheduling;
//import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
//
//import java.util.concurrent.Executor;
//// 启用定时任务功能，等价于在主类加 @EnableScheduling
////@EnableScheduling
//
//@Slf4j
//// 标记为配置类，Spring 会扫描并加载
//@Configuration
//@EnableAsync
//public class SpringAsyncJobConfig implements AsyncConfigurer {
//
//    @Override
//    @Bean(name = "taskExecutor")
//    public Executor getAsyncExecutor() {
//        ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
//        executor.setCorePoolSize(5);      // 核心线程数
//        executor.setMaxPoolSize(10);      // 最大线程数
//        executor.setQueueCapacity(25);    // 队列容量
//        executor.setThreadNamePrefix("MyAsync-");
//        executor.initialize();
//        return executor;
//    }
//}
